//Created by  for Jaws.Core.Web
//Original work Copyright(C) 2008.  All Rights Reserved.

using System;
using System.Xml.Serialization;
using Jaws.Core.Web.Entities.Categories;
using Jaws.Core.Web.Entities.Comments;
using Jaws.Core.Web.Entities.Tags;

namespace Jaws.Core.Web.Entities.Post
{
    [Serializable]
    [XmlDataDirectory("posts")]
    public class Post : XmlBusinessBase<Post>, ICommentable, ICategories, ITagable
    {

        public string Title { get; set; }

        public string Description { get; set; }

        public string Keywords { get; set; }

        public string Slug { get; set; }

        [XmlIgnore]
        public bool IsVisible { get; set; }

        [XmlIgnore]
        public string RelativeLink
        {
            get
            {
                string slug = Utils.RemoveIllegalCharacters(Slug) + ".aspx";
                return Utils.RelativeWebRoot + "page/" + slug;
            }
        }

        public Guid Parent { get; set; }

        public bool ShowInList { get; set; }

        public bool IsHomePage { get; set; }

        #region Implementation of ICommentable

        public CommentsCollection Comments { get; set; }

        #endregion

        #region Implementation of ICategories

        public CategoryCollection CategoryCollection { get; set; }

        #endregion

        #region Implementation of ITagable

        public TagCollection TagCollection { get; set; }

        public string Author { get; set; }

        public string Content { get; set; }

        public bool IsPublished { get; set; }

        public bool IsCommentsEnabled { get; set; }

        public Uri AbsoluteLink { get; set; }

        #endregion
    }

}